<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />  
  <title>Cash Wave</title>
  <meta name="referrer" content="unsafe-url">
  <meta name="theme-color" content="#000000" />
  <meta name="description" content="Cash Wave" />
  <meta name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="referrer" content="unsafe-url">
  <meta name="theme-color" content="#000000" />
  <link rel="icon" href="/h5cashwave/faviconpic.ico" />
  <link rel="manifest" href="/h5cashwave/manifest.json" />

  <!-- Adjust Smart Script -->
  <script>
      // build a new URL with parameters p0-p6, fbclid and fbpaid
      function buildURL(p0, p1, p2, p3, p4, p5, p6, fbclid, fbpid) {
        if (!p0) {
          return null;
        }
        tracker_token = p0;
        if (p1 || p2) {
          campaign = p1 + "(" + p2 + ")";
        } else {
          campaign = "";
        }
        if (p3 || p4) {
          adgroup = p3 + "(" + p4 + ")";
        } else {
          adgroup = "";
        }
        if (p5 || p6) {
          creative = p5 + "(" + p6 + ")";
        } else {
          creative = "";
        }
        if (!fbclid) {
          fbclid = "";
        }
        if (!fbpid) {
          fbpid = "";
        }
        // build a tracker URL
        let params = { campaign, adgroup, creative, fbclid, fbpid };
        let newURL =
          "https://app.adjust.com/" +
          tracker_token +
          "?" +
          Object.keys(params)
            .map((key) => key + "=" + encodeURIComponent(params[key]))
            .join("&");
        return newURL;
      }
  
      //get fbpid from Cookie written by Facebook Pixel
      function getFbPid() {
        let fbPid = document.cookie.match(/(^|;) ?_fbp=([^;]*)(;|$)/);
        if (fbPid) {
          return fbPid[2];
        } else {
          return null;
        }
      }
  
      // get query string, and parse it with URLSearchParams
      const urlParams = new URLSearchParams(window.location.search);
      //p0 = urlParams.get("p0") and fallback to "default"
      let p0 = urlParams.get("p0");
      let p1 = urlParams.get("p1");
      let p2 = urlParams.get("p2");
      let p3 = urlParams.get("p3");
      let p4 = urlParams.get("p4");
      let p5 = urlParams.get("p5");
      let p6 = urlParams.get("p6");
      let fbPid = getFbPid();
      let fbClickId = urlParams.get("fbclid");
      let url = buildURL(p0, p1, p2, p3, p4, p5, p6, fbClickId, fbPid);
  
      window.AD_TRACKER_URL = url;
  
      // add links
      // window.addEventListener("DOMContentLoaded", function () {
      //   if (url) {
      //     var elements = document.querySelectorAll(".AdjustTracker")
      //     for (var i = 0; i < elements.length; i++) {
      //       elements[i].setAttribute("href", url);
  
      //     }
      //   }
      // });
  </script>
  <!-- End Adjust Smart Script -->

  <!-- Meta Pixel Code -->
  <script>
    !function (f, b, e, v, n, t, s) {
      if (f.fbq) return; n = f.fbq = function () {
        n.callMethod ?
          n.callMethod.apply(n, arguments) : n.queue.push(arguments)
      };
      if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0';
      n.queue = []; t = b.createElement(e); t.async = !0;
      t.src = v; s = b.getElementsByTagName(e)[0];
      s.parentNode.insertBefore(t, s)
    }(window, document, 'script',
      'https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', '1106828180666341');
    fbq('track', 'PageView');
  </script>
  <noscript>
    <img height="1" width="1" style="display:none"
      src="https://www.facebook.com/tr?id=1106828180666341&ev=PageView&noscript=1" />
  </noscript>
  <!-- End Meta Pixel Code -->


  <meta name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
  <script src="https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js"></script>

  <script>
    if ('addEventListener' in document) {
      document.addEventListener('DOMContentLoaded', function () {
        FastClick.attach(document.body);
      }, false);
    }
    if (!window.Promise) {
      document.writeln('<script src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"' + '>' + '<' + '/' + 'script>');
    }

    function adapter() {
      //获取手机横向的设备独立像素
      const dip = document.documentElement.clientWidth
      //计算根字体大小(100是我们自己指定的，375是设计稿宽度)
      let rootFontSize = dip / 10
      if (dip > 750) {
        rootFontSize = 750 / 10
      }
      //设置根字体
      document.documentElement.style.fontSize = rootFontSize + 'px'
    }
    adapter()

    window.onresize = adapter
  </script>

</head>

<body>
  <div id="root"></div>
</body>

</html>